from django.urls import re_path

from . import views

app_name = 'blogs'

urlpatterns = [
	# 主页
	re_path(r'^$',views.index,name='index'),
	# 所有版块
	re_path(r'^topics/$',views.topics,name='topics'),
	# 单个版块
	re_path(r'^topics/(?P<topic_id>\d+)/$',views.topic,name='topic'),
	# 新版块
	re_path(r'^topics/new_topic/$',views.new_topic,name='new_topic'),
	# 新blog
	re_path(r'^blog/new_blog/(?P<topic_id>\d+)/$',views.new_blog,name='new_blog'),
	# 编辑blog
	re_path(r'^blog/edit_blog/(?P<blog_id>\d+)/$',views.edit_blog,name='edit_blog'),
	# 查看blog
	re_path(r'^blog/(?P<blog_id>\d+)/$',views.blog,name='blog'),
	# 评论
	re_path(r'^blog/comment/(?P<blog_id>\d+)/$',views.comment,name='comment'),
	# 删除blog
	re_path(r'^blog/delete/(?P<blog_id>\d+)/$',views.delete_blog,name='delete_blog'),
	# 删除评论
	re_path(r'^blog/delete_comment/(?P<comment_id>\d+)/$',views.delete_comment,name='delete_comment'),
]
